<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html;" charset="<?php echo CHARSET;?>">
<title>本地生活</title>
<link href="/Public/admin/css/skin_0.css" rel="stylesheet" type="text/css" id="cssfile"/>
<script type="text/javascript" src="/Public/static/jquery.js"></script>
<script type="text/javascript" src="/Public/static/jquery.validation.min.js"></script>
<script type="text/javascript" src="/Public/admin/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/Public/admin/js/admincp.js"></script>
<script type="text/javascript" src="/Public/admin/js/jquery.tooltip.js"></script>
<script language="javascript">
var SiteUrl = '<?php echo (C("SiteUrl")); ?>';
var AdminUrl = SiteUrl+'/<?php echo (MODULE_NAME); ?>';
</script>
</head><body>
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>订单管理</h3>
      <ul class="tab-base">
        <li><a href="JavaScript:void(0);" class="current"><span>订单管理</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form method="get" name="formSearch">
    <table class="tb-type1 noborder search">
      <tbody>
        <tr>
          <th><label>订单状态</label></th>
          <td colspan="4"><select name="order_state" class="querySelect">
              <option value="">请选择...</option>
              <option value="10" <?php if($search['order_state'] == 10): ?>selected<?php endif; ?>>待付款</option>
              <option value="20" <?php if($search['order_state'] == 20): ?>selected<?php endif; ?>>已付款</option>
              <option value="30" <?php if($search['order_state'] == 30): ?>selected<?php endif; ?>>已发货</option>
              <option value="40" <?php if($search['order_state'] == 40): ?>selected<?php endif; ?>>已收货</option>
              <option value="50" <?php if($search['order_state'] == 50): ?>selected<?php endif; ?>>已完成</option>
              <option value="60" <?php if($search['order_state'] == 60): ?>selected<?php endif; ?>>已取消</option>
            </select>
            <label style=" margin-left:20px;">类型</label>
            <select name="field" class="querySelect">
              <option value="order_sn" <?php if($search['field'] == 'order_sn'): ?>selected<?php endif; ?>>订单号</option>
              <option value="buyer_name" <?php if($search['field'] == 'buyer_name'): ?>selected<?php endif; ?>>买家名称</option>
            </select>
            <input class="txt2" type="text" name="search_name" value="" />
            </td>
        </tr>
        <tr>
          <th><label for="add_time_from">下单时间</label></th>
          <td><input class="txt date" type="text" value="<?php echo ($search['add_time_from']); ?>" id="add_time_from" name="add_time_from">
            <label for="add_time_to">~</label>
            <input class="txt date" type="text" value="<?php echo ($search['add_time_to']); ?>" id="add_time_to" name="add_time_to"/></td>
          <th><label for="order_amount_from">订单金额</label></th>
          <td><input class="txt-short" type="text" value="<?php echo ($search['order_amount_from']); ?>" name="order_amount_from" id="order_amount_from"/>
            <label for="order_amount_to">~</label>
            <input class="txt-short" type="text" value="<?php echo ($search['order_amount_from']); ?>" name="order_amount_to" id="order_amount_to"/></td>
          <td><a href="javascript:document.formSearch.submit();" class="btn-search tooltip" title="查询">&nbsp;</a></td>
        </tr>
      </tbody>
    </table>
  </form>
  <table class="table tb-type2" id="prompt">
    <tbody>
      <tr class="space odd">
        <th colspan="12"><div class="title"><h5>操作提示</h5><span class="arrow"></span></div></th>
      </tr>
      <tr>
        <td>
        <ul>
            <li>点击查看操作将显示订单（包括订单物品）的详细信息</li>
          </ul></td>
      </tr>
    </tbody>
  </table>
  <table class="table tb-type2 nobdb">
    <thead>
      <tr class="thead">
        <th>订单号</th>
        <th>买家</th>
        <th class="align-center">下单时间</th>
        <th class="align-center">订单总额</th>
        <th class="align-center">支付方式</th>
        <th class="align-center">订单状态</th>
        <th class="align-center">操作</th>
      </tr>
    </thead>
    <tbody>
     <?php if(!empty($list)): if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class="hover">
        <td><?php echo ($vo['order_sn']); ?></td>
        <td><?php echo ($vo['buyer_name']); ?></td>
        <td class="nowrap align-center"><?php echo (date('Y-m-d H:i:s',$vo['add_time'])); ?></td>
        <td class="align-center"><?php echo ($vo['order_amount']); ?></td>
        <td class="align-center"><?php echo ($vo['payment_name']); ?></td>
        <td class="align-center">
        	<?php if($vo['order_state'] == 10): ?>待付款
            <?php elseif($vo['order_state'] == 20): ?>已付款
            <?php elseif($vo['order_state'] == 30): ?>已发货
            <?php elseif($vo['order_state'] == 40): ?>已收货
            <?php elseif($vo['order_state'] == 50): ?>已完成
            <?php else: ?>已取消<?php endif; ?>
        </td>
        <td class="w60 align-center">
        <?php if($vo['order_state'] == 20): ?><!--<a href="<?php echo U('Order/order_op',array('order_id'=>$vo['order_id']));?>">发货</a> | --><?php endif; ?>
        <a href="<?php echo U('Order/order_view',array('order_id'=>$vo['order_id']));?>">查看</a>
        </td>
      </tr><?php endforeach; endif; else: echo "" ;endif; ?>
      <?php else: ?>
      <tr class="no_data">
        <td colspan="15">没有符合条件的记录</td>
      </tr><?php endif; ?>
    </tbody>
    <tfoot>
      <tr class="tfoot">
        <td colspan="15" id="dataFuncs"><div class="pagination"> <?php echo ($page_show); ?> </div></td>
      </tr>
    </tfoot>
  </table>
</div>
<script type="text/javascript" src="/Public/static/jquery-ui/jquery.ui.js"></script> 
<script type="text/javascript" src="/Public/static/jquery-ui/i18n/zh-CN.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="/Public/static/jquery-ui/themes/ui-lightness/jquery.ui.css"  />
<script type="text/javascript">
$(function(){
    $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd'});
    $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd'});
});
</script> 
</body></html>